
<div class="page_title">用户列表</div>
<div id="list">
	<div id="table_title" class="clearfix">
		<div class="WIDTH50">ID</div>
		<div class="WIDTH70">用户名</div>
		<div class="WIDTH90">用户类型</div>
		<div class="WIDTH120">院系</div>
		<div class="WIDTH80">真实姓名</div>
		<div class="WIDTH100">电话</div>
		<div class="WIDTH70">传真</div>
		<div class="WIDTH160">邮箱</div>
	</div>

<?php
$i = true;
$action = $_GET ['action'];
$currentPage = $data ['currentPage'];
$pageNum = $data ['pageNum'];
if (count ( $data ['users'] ) > 0)
	foreach ( $data ['users'] as $row ) :
		?>
		<?php $i =!$i;?>
	<div class="row <?php if($i) echo "highlight"; ?> clearfix">
		<div class="WIDTH50"><?php echo $row->id?></div>
		<div class="WIDTH70"><?php echo $row->username;?></div>
		<div class="WIDTH90">
		<?php
		if ($row->type == UserBean::$_ADMIN)
			echo "<span style='color:red;'>管理员</span>";
		elseif ($row->type == UserBean::$_INSTITUE)
			echo "院系";
		elseif($row->type ==UserBean::$_SENATE)
			echo "<span style='color:blue;'>教务处</span>";
		else 
			echo "未知类型";
		?>
		</div>
		<div class="WIDTH120"><?php echo getInstitute($row->department); ?></div>
		<div class="WIDTH80"><?php echo $row->name; ?></div>
		<div class="WIDTH100"><?php echo $row->phone; ?></div>
		<div class="WIDTH70"><?php echo $row->fax; ?></div>
		<div class="WIDTH160"><?php echo $row->email; ?></div>

	</div>
	<div class="operator clearfix">
		<div class="button ajaxbtn"
			name="user_adduser_id_<?php echo $row->id;?>">修改</div>
		<div name="user_delete_id_<?php echo $row->id; ?>"
			class="ajaxbtn button">删除</div>
	</div>
<?php endforeach;?>
</div>
<div id="pages_bar">
		<?php if($currentPage>1):?>
		<div id="lastpage"
		name="user_<?php echo $action."_page_".($currentPage-1);?>"
		class="ajaxbtn">上一页</div>
		<?php endif;?>
		<?php if($pageNum>1):?>
		<?php for($i=1;$i<=$pageNum;$i++):?>
		<div name="user_<?php echo $action."_page_".$i;?>"
		class="page_item <?php echo ($currentPage==$i)?"selected":"ajaxbtn";?>"><?php echo $i;?></div>
		<?php endfor;?>
		<?php endif;?>
		<?php if($currentPage<$pageNum):?>
		<div id="nextpage"
		name="user_<?php echo $action."_page_".($currentPage+1);?>"
		class="ajaxbtn">下一页</div>
		<?php endif?>